home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / samples / zscript / replycc.zsc.z / replycc.zsc
Encoding:
Text File  |  1997-01-22  |  1.1 KB  |  46 lines

  1. # Sample Z-Script functions: add_cc, cc_all
  2.  
  3. # These two functions implement a reply with all recipients
  4. # included on the Cc: line and only the senders on the To: line
  5. #
  6. function add_cc() {
  7.     msg_list - $1
  8.     #
  9.     # This works only in 2.1, not 2.0.5 ...
  10.     #
  11.     set cc_to += ",$[%?To?,%?Cc?]"
  12. }
  13.  
  14. function cc_all() {
  15. #%
  16. #     cc_all [msg-list] [-r path] [mail-flags] [recipients]
  17. #
  18. # Reply to the messages indicated by the optional msg-list, placing all
  19. # recipients of the messages on the Cc: line and the senders of the
  20. # messages on the To: line.  Otherwise the same as "replyall".
  21. #%
  22.     set msgs cc_to        # Initialize
  23.     #
  24.     # Combine argument messages with piped input ...
  25.     #
  26.     shift -m | set msgs
  27.     if $?input
  28.        msg_list $msgs $input | set msgs
  29.     endif
  30.     #
  31.     # Generate Cc: addresses ...
  32.     #
  33.     each $msgs add_cc
  34.     #
  35.     # BUG:        (to be fixed in 2.2)
  36.     # Fails if there are more than 1000 characters in $cc_to ...
  37.     #
  38.     replysender $msgs -c "$cc_to" $*
  39.     set _stat = $status
  40.     #
  41.     # Sneaky way to clean up after ourself ...
  42.     #
  43.     msg_list $msgs | unset msgs cc_to
  44.     return $_stat
  45. }
  46.